!function(I,U){"object"==typeof exports&&typeof module<"u"?module.exports=U():"function"==typeof define&&define.amd?define(U):(I=typeof globalThis<"u"?globalThis:I||self).flatpickr=U()}(this,function(){"use strict";var I=function(){return(I=Object.assign||function(a){for(var r,e=1,p=arguments.length;e",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Z={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(a){var r=a%100;if(r>3&&r<21)return"th";switch(r%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},F=function(a,r){return void 0===r&&(r=2),("000"+a).slice(-1*r)},P=function(a){return!0===a?1:0};function Ae(a,r){var e;return function(){var p=this,v=arguments;clearTimeout(e),e=setTimeout(function(){return a.apply(p,v)},r)}}var we=function(a){return a instanceof Array?a:[a]};function S(a,r,e){if(!0===e)return a.classList.add(r);a.classList.remove(r)}function w(a,r,e){var p=window.document.createElement(a);return e=e||"",p.className=r=r||"",void 0!==e&&(p.textContent=e),p}function ie(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function Ne(a,r){return r(a)?a:a.parentNode?Ne(a.parentNode,r):void 0}function oe(a,r){var e=w("div","numInputWrapper"),p=w("input","numInput "+a),v=w("span","arrowUp"),h=w("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?p.type="number":(p.type="text",p.pattern="\\d*"),void 0!==r)for(var M in r)p.setAttribute(M,r[M]);return e.appendChild(p),e.appendChild(v),e.appendChild(h),e}function A(a){try{return"function"==typeof a.composedPath?a.composedPath()[0]:a.target}catch{return a.target}}var be=function(){},re=function(a,r,e){return e.months[r?"shorthand":"longhand"][a]},qe={D:be,F:function(a,r,e){a.setMonth(e.months.longhand.indexOf(r))},G:function(a,r){a.setHours((a.getHours()>=12?12:0)+parseFloat(r))},H:function(a,r){a.setHours(parseFloat(r))},J:function(a,r){a.setDate(parseFloat(r))},K:function(a,r,e){a.setHours(a.getHours()%12+12*P(new RegExp(e.amPM[1],"i").test(r)))},M:function(a,r,e){a.setMonth(e.months.shorthand.indexOf(r))},S:function(a,r){a.setSeconds(parseFloat(r))},U:function(a,r){return new Date(1e3*parseFloat(r))},W:function(a,r,e){var p=parseInt(r),v=new Date(a.getFullYear(),0,2+7*(p-1),0,0,0,0);return v.setDate(v.getDate()-v.getDay()+e.firstDayOfWeek),v},Y:function(a,r){a.setFullYear(parseFloat(r))},Z:function(a,r){return new Date(r)},d:function(a,r){a.setDate(parseFloat(r))},h:function(a,r){a.setHours((a.getHours()>=12?12:0)+parseFloat(r))},i:function(a,r){a.setMinutes(parseFloat(r))},j:function(a,r){a.setDate(parseFloat(r))},l:be,m:function(a,r){a.setMonth(parseFloat(r)-1)},n:function(a,r){a.setMonth(parseFloat(r)-1)},s:function(a,r){a.setSeconds(parseFloat(r))},u:function(a,r){return new Date(parseFloat(r))},w:be,y:function(a,r){a.setFullYear(2e3+parseFloat(r))}},J={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Q={Z:function(a){return a.toISOString()},D:function(a,r,e){return r.weekdays.shorthand[Q.w(a,r,e)]},F:function(a,r,e){return re(Q.n(a,r,e)-1,!1,r)},G:function(a,r,e){return F(Q.h(a,r,e))},H:function(a){return F(a.getHours())},J:function(a,r){return void 0!==r.ordinal?a.getDate()+r.ordinal(a.getDate()):a.getDate()},K:function(a,r){return r.amPM[P(a.getHours()>11)]},M:function(a,r){return re(a.getMonth(),!0,r)},S:function(a){return F(a.getSeconds())},U:function(a){return a.getTime()/1e3},W:function(a,r,e){return e.getWeek(a)},Y:function(a){return F(a.getFullYear(),4)},d:function(a){return F(a.getDate())},h:function(a){return a.getHours()%12?a.getHours()%12:12},i:function(a){return F(a.getMinutes())},j:function(a){return a.getDate()},l:function(a,r){return r.weekdays.longhand[a.getDay()]},m:function(a){return F(a.getMonth()+1)},n:function(a){return a.getMonth()+1},s:function(a){return a.getSeconds()},u:function(a){return a.getTime()},w:function(a){return a.getDay()},y:function(a){return String(a.getFullYear()).substring(2)}},Pe=function(a){var r=a.config,e=void 0===r?q:r,p=a.l10n,v=void 0===p?Z:p,h=a.isMobile,M=void 0!==h&&h;return function(T,_,E){var V=E||v;return void 0===e.formatDate||M?_.split("").map(function(D,H,j){return Q[D]&&"\\"!==j[H-1]?Q[D](T,V,e):"\\"!==D?D:""}).join(""):e.formatDate(T,_,V)}},Ce=function(a){var r=a.config,e=void 0===r?q:r,p=a.l10n,v=void 0===p?Z:p;return function(h,M,T,_){if(0===h||h){var E,V=_||v,D=h;if(h instanceof Date)E=new Date(h.getTime());else if("string"!=typeof h&&void 0!==h.toFixed)E=new Date(h);else if("string"==typeof h){var H=M||(e||q).dateFormat,j=String(h).trim();if("today"===j)E=new Date,T=!0;else if(e&&e.parseDate)E=e.parseDate(h,H);else if(/Z$/.test(j)||/GMT$/.test(j))E=new Date(h);else{for(var le=void 0,z=[],L=0,X=0,B="";L=0?new Date:new Date(e.config.minDate.getTime()),i=ye(e.config);t.setHours(i.hours,i.minutes,i.seconds,t.getMilliseconds()),e.selectedDates=[t],e.latestSelectedDateObj=t}void 0!==n&&"blur"!==n.type&&function(l){l.preventDefault();var s="keydown"===l.type,u=A(l),c=u;void 0!==e.amPM&&u===e.amPM&&(e.amPM.textContent=e.l10n.amPM[P(e.amPM.textContent===e.l10n.amPM[0])]);var f=parseFloat(c.getAttribute("min")),d=parseFloat(c.getAttribute("max")),m=parseFloat(c.getAttribute("step")),g=parseInt(c.value,10),C=g+m*(l.delta||(s?38===l.which?1:-1:0));if(void 0!==c.value&&2===c.value.length){var y=c===e.hourElement,O=c===e.minuteElement;Cd&&(C=c===e.hourElement?C-d-P(!e.amPM):f,O&&z(void 0,1,e.hourElement)),e.amPM&&y&&(1===m?C+g===23:Math.abs(C-g)>m)&&(e.amPM.textContent=e.l10n.amPM[P(e.amPM.textContent===e.l10n.amPM[0])]),c.value=F(C)}}(n);var o=e._input.value;T(),W(),e._input.value!==o&&e._debouncedChange()}function T(){if(void 0!==e.hourElement&&void 0!==e.minuteElement){var i=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,o=(parseInt(e.minuteElement.value,10)||0)%60,l=void 0!==e.secondElement?(parseInt(e.secondElement.value,10)||0)%60:0;void 0!==e.amPM&&(i=i%12+12*P(e.amPM.textContent===e.l10n.amPM[1]));var s=void 0!==e.config.minTime||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&0===N(e.latestSelectedDateObj,e.config.minDate,!0),u=void 0!==e.config.maxTime||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&0===N(e.latestSelectedDateObj,e.config.maxDate,!0);if(void 0!==e.config.maxTime&&void 0!==e.config.minTime&&e.config.minTime>e.config.maxTime){var c=Me(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),f=Me(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),d=Me(i,o,l);if(d>f&&d=12)]),void 0!==e.secondElement&&(e.secondElement.value=F(i)))}function V(n){var t=A(n),i=parseInt(t.value)+(n.delta||0);(i/1e3>1||"Enter"===n.key&&!/[^\d]/.test(i.toString()))&&fe(i)}function D(n,t,i,o){return t instanceof Array?t.forEach(function(l){return D(n,l,i,o)}):n instanceof Array?n.forEach(function(l){return D(l,t,i,o)}):(n.addEventListener(t,i,o),void e._handlers.push({remove:function(){return n.removeEventListener(t,i,o)}}))}function H(){x("onChange")}function j(n,t){var i=void 0!==n?e.parseDate(n):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate=0&&N(u,e.selectedDates[1])<=0)&&!Ie(t)&&s.classList.add("inRange"),e.weekNumbers&&1===e.config.showMonths&&"prevMonthDay"!==n&&o%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend",""+e.config.getWeek(t)+""),x("onDayCreate",s),s}function X(n){n.focus(),"range"===e.config.mode&&ge(n)}function B(n){for(var i=n>0?e.config.showMonths:-1,o=n>0?0:e.config.showMonths-1;o!=i;o+=n)for(var l=e.daysContainer.children[o],u=n>0?l.children.length:-1,c=n>0?0:l.children.length-1;c!=u;c+=n){var f=l.children[c];if(-1===f.className.indexOf("hidden")&&K(f.dateObj))return f}}function Y(n,t){var i=p(),o=me(i||document.body),l=void 0!==n?n:o?i:void 0!==e.selectedDateElem&&me(e.selectedDateElem)?e.selectedDateElem:void 0!==e.todayDateElem&&me(e.todayDateElem)?e.todayDateElem:B(t>0?1:-1);void 0===l?e._input.focus():o?function(s,u){for(var c=-1===s.className.indexOf("Month")?s.dateObj.getMonth():e.currentMonth,f=u>0?e.config.showMonths:-1,d=u>0?1:-1,m=c-e.currentMonth;m!=f;m+=d)for(var g=e.daysContainer.children[m],C=g.children.length,y=c-e.currentMonth===m?s.$i+u:u<0?g.children.length-1:0;y>=0&&y0?C:-1);y+=d){var O=g.children[y];if(-1===O.className.indexOf("hidden")&&K(O.dateObj)&&Math.abs(s.$i-y)>=Math.abs(u))return X(O)}e.changeMonth(d),Y(B(d),0)}(l,t):X(l)}function ce(n,t){for(var i=(new Date(n,t,1).getDay()-e.l10n.firstDayOfWeek+7)%7,o=e.utils.getDaysInMonth((t-1+12)%12,n),l=e.utils.getDaysInMonth(t,n),s=window.document.createDocumentFragment(),u=e.config.showMonths>1,c=u?"prevMonthDay hidden":"prevMonthDay",f=u?"nextMonthDay hidden":"nextMonthDay",d=o+1-i,m=0;d<=o;d++,m++)s.appendChild(L("flatpickr-day "+c,new Date(n,t-1,d),0,m));for(d=1;d<=l;d++,m++)s.appendChild(L("flatpickr-day",new Date(n,t,d),0,m));for(var g=l+1;g<=42-i&&(1===e.config.showMonths||m%7!=0);g++,m++)s.appendChild(L("flatpickr-day "+f,new Date(n,t+1,g%l),0,m));var b=w("div","dayContainer");return b.appendChild(s),b}function G(){if(void 0!==e.daysContainer){ie(e.daysContainer),e.weekNumbers&&ie(e.weekNumbers);for(var n=document.createDocumentFragment(),t=0;t1||"dropdown"!==e.config.monthSelectorType)){e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(o=t,!(void 0!==e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&oe.config.maxDate.getMonth())){var i=w("option","flatpickr-monthDropdown-month");i.value=new Date(e.currentYear,t).getMonth().toString(),i.textContent=re(t,e.config.shorthandCurrentMonth,e.l10n),i.tabIndex=-1,e.currentMonth===t&&(i.selected=!0),e.monthsDropdownContainer.appendChild(i)}}var o}function se(){var n,t=w("div","flatpickr-month"),i=window.document.createDocumentFragment();e.config.showMonths>1||"static"===e.config.monthSelectorType?n=w("span","cur-month"):(e.monthsDropdownContainer=w("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),D(e.monthsDropdownContainer,"change",function(u){var c=A(u),f=parseInt(c.value,10);e.changeMonth(f-e.currentMonth),x("onMonthChange")}),R(),n=e.monthsDropdownContainer);var o=oe("cur-year",{tabindex:"-1"}),l=o.getElementsByTagName("input")[0];l.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&l.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(l.setAttribute("max",e.config.maxDate.getFullYear().toString()),l.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var s=w("div","flatpickr-current-month");return s.appendChild(n),s.appendChild(o),i.appendChild(s),t.appendChild(i),{container:t,yearElement:l,monthElement:n}}function de(){ie(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var n=e.config.showMonths;n--;){var t=se();e.yearElements.push(t.yearElement),e.monthElements.push(t.monthElement),e.monthNav.appendChild(t.container)}e.monthNav.appendChild(e.nextMonthNav)}function ue(){e.weekdayContainer?ie(e.weekdayContainer):e.weekdayContainer=w("div","flatpickr-weekdays");for(var n=e.config.showMonths;n--;){var t=w("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(t)}return Ye(),e.weekdayContainer}function Ye(){if(e.weekdayContainer){var n=e.l10n.firstDayOfWeek,t=U(e.l10n.weekdays.shorthand);n>0&&n\n "+t.join("")+"\n \n "}}function xe(n,t){void 0===t&&(t=!0);var i=t?n:n-e.currentMonth;i<0&&!0===e._hidePrevMonthArrow||i>0&&!0===e._hideNextMonthArrow||(e.currentMonth+=i,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,x("onYearChange"),R()),G(),x("onMonthChange"),ve())}function ee(n){return e.calendarContainer.contains(n)}function Ee(n){if(e.isOpen&&!e.config.inline){var t=A(n),i=ee(t),o=!(t===e.input||t===e.altInput||e.element.contains(t)||n.path&&n.path.indexOf&&(~n.path.indexOf(e.input)||~n.path.indexOf(e.altInput))||i||ee(n.relatedTarget)),l=!e.config.ignoredFocusElements.some(function(s){return s.contains(t)});o&&l&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),void 0!==e.timeContainer&&void 0!==e.minuteElement&&void 0!==e.hourElement&&""!==e.input.value&&void 0!==e.input.value&&M(),e.close(),e.config&&"range"===e.config.mode&&1===e.selectedDates.length&&e.clear(!1))}}function fe(n){if(!(!n||e.config.minDate&&ne.config.maxDate.getFullYear())){var i=e.currentYear!==n;e.currentYear=n||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),i&&(e.redraw(),x("onYearChange"),R())}}function K(n,t){var i;void 0===t&&(t=!0);var o=e.parseDate(n,void 0,t);if(e.config.minDate&&o&&N(o,e.config.minDate,void 0!==t?t:!e.minDateHasTime)<0||e.config.maxDate&&o&&N(o,e.config.maxDate,void 0!==t?t:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&0===e.config.disable.length)return!0;if(void 0===o)return!1;for(var l=!!e.config.enable,s=null!==(i=e.config.enable)&&void 0!==i?i:e.config.disable,u=0,c=void 0;u=c.from.getTime()&&o.getTime()<=c.to.getTime())return l}return!l}function me(n){return void 0!==e.daysContainer&&-1===n.className.indexOf("hidden")&&-1===n.className.indexOf("flatpickr-disabled")&&e.daysContainer.contains(n)}function ze(n){var t=n.target===e._input,i=e._input.value.trimEnd()!==Se();!t||!i||n.relatedTarget&&ee(n.relatedTarget)||e.setDate(e._input.value,!0,n.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function je(n){var t=A(n),i=e.config.wrap?a.contains(t):t===e._input,o=e.config.allowInput,l=e.isOpen&&(!o||!i),s=e.config.inline&&i&&!o;if(13===n.keyCode&&i){if(o)return e.setDate(e._input.value,!0,t===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),t.blur();e.open()}else if(ee(t)||l||s){var u=!!e.timeContainer&&e.timeContainer.contains(t);switch(n.keyCode){case 13:u?(n.preventDefault(),M(),ke()):Be(n);break;case 27:n.preventDefault(),ke();break;case 8:case 46:i&&!e.config.allowInput&&(n.preventDefault(),e.clear());break;case 37:case 39:if(u||i)e.hourElement&&e.hourElement.focus();else{n.preventDefault();var c=p();if(void 0!==e.daysContainer&&(!1===o||c&&me(c))){var f=39===n.keyCode?1:-1;n.ctrlKey?(n.stopPropagation(),xe(f),Y(B(1),0)):Y(void 0,f)}}break;case 38:case 40:n.preventDefault();var d=40===n.keyCode?1:-1;e.daysContainer&&void 0!==t.$i||t===e.input||t===e.altInput?n.ctrlKey?(n.stopPropagation(),fe(e.currentYear-d),Y(B(1),0)):u||Y(void 0,7*d):t===e.currentYearElement?fe(e.currentYear-d):e.config.enableTime&&(!u&&e.hourElement&&e.hourElement.focus(),M(n),e._debouncedChange());break;case 9:if(u){var m=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(C){return C}),g=m.indexOf(t);if(-1!==g){var b=m[g+(n.shiftKey?-1:1)];n.preventDefault(),(b||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(t)&&n.shiftKey&&(n.preventDefault(),e._input.focus())}}if(void 0!==e.amPM&&t===e.amPM)switch(n.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],T(),W();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],T(),W()}(i||ee(t))&&x("onKeyDown",n)}function ge(n,t){if(void 0===t&&(t="flatpickr-day"),1===e.selectedDates.length&&(!n||n.classList.contains(t)&&!n.classList.contains("flatpickr-disabled"))){for(var i=n?n.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),o=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),l=Math.min(i,e.selectedDates[0].getTime()),s=Math.max(i,e.selectedDates[0].getTime()),u=!1,c=0,f=0,d=l;dl&&dc)?c=d:d>o&&(!f||d ."+t)).forEach(function(m){var g,b,C,y=m.dateObj.getTime(),O=c>0&&y0&&y>f;if(O)return m.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(te){m.classList.remove(te)});u&&!O||(["startRange","inRange","endRange","notAllowed"].forEach(function(te){m.classList.remove(te)}),void 0!==n&&(n.classList.add(i<=e.selectedDates[0].getTime()?"startRange":"endRange"),oi&&y===o&&m.classList.add("endRange"),y>=c&&(0===f||y<=f)&&(b=o,C=i,(g=y)>Math.min(b,C)&&g0||i.getMinutes()>0||i.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(l){return K(l)}),e.selectedDates.length||"min"!==n||_(i),W()),e.daysContainer&&(We(),void 0!==i?e.currentYearElement[n]=i.getFullYear().toString():e.currentYearElement.removeAttribute(n),e.currentYearElement.disabled=!!o&&void 0!==i&&o.getFullYear()===i.getFullYear())}}function Le(){return e.config.wrap?a.querySelector("[data-input]"):a}function Re(){"object"!=typeof e.config.locale&&void 0===k.l10ns[e.config.locale]&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=I(I({},k.l10ns.default),"object"==typeof e.config.locale?e.config.locale:"default"!==e.config.locale?k.l10ns[e.config.locale]:void 0),J.D="("+e.l10n.weekdays.shorthand.join("|")+")",J.l="("+e.l10n.weekdays.longhand.join("|")+")",J.M="("+e.l10n.months.shorthand.join("|")+")",J.F="("+e.l10n.months.longhand.join("|")+")",J.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",void 0===I(I({},r),JSON.parse(JSON.stringify(a.dataset||{}))).time_24hr&&void 0===k.defaultConfig.time_24hr&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Pe(e),e.parseDate=Ce({config:e.config,l10n:e.l10n})}function pe(n){if("function"!=typeof e.config.position){if(void 0!==e.calendarContainer){x("onPreCalendarPosition");var t=n||e._positionElement,i=Array.prototype.reduce.call(e.calendarContainer.children,function(ne,ae){return ne+ae.offsetHeight},0),o=e.calendarContainer.offsetWidth,l=e.config.position.split(" "),s=l[0],u=l.length>1?l[1]:null,c=t.getBoundingClientRect(),f=window.innerHeight-c.bottom,d="above"===s||"below"!==s&&fi,m=window.pageYOffset+c.top+(d?-i-2:t.offsetHeight+2);if(S(e.calendarContainer,"arrowTop",!d),S(e.calendarContainer,"arrowBottom",d),!e.config.inline){var g=window.pageXOffset+c.left,b=!1,C=!1;"center"===u?(g-=(o-c.width)/2,b=!0):"right"===u&&(g-=o-c.width,C=!0),S(e.calendarContainer,"arrowLeft",!b&&!C),S(e.calendarContainer,"arrowCenter",b),S(e.calendarContainer,"arrowRight",C);var y=window.document.body.offsetWidth-(window.pageXOffset+c.right),O=g+o>window.document.body.offsetWidth,te=y+o>window.document.body.offsetWidth;if(S(e.calendarContainer,"rightMost",O),!e.config.static)if(e.calendarContainer.style.top=m+"px",O)if(te){var _e=function(){for(var ne=null,ae=0;aee.currentMonth+e.config.showMonths-1)&&"range"!==e.config.mode;if(e.selectedDateElem=i,"single"===e.config.mode)e.selectedDates=[o];else if("multiple"===e.config.mode){var s=Ie(o);s?e.selectedDates.splice(parseInt(s),1):e.selectedDates.push(o)}else"range"===e.config.mode&&(2===e.selectedDates.length&&e.clear(!1,!1),e.latestSelectedDateObj=o,e.selectedDates.push(o),0!==N(o,e.selectedDates[0],!0)&&e.selectedDates.sort(function(d,m){return d.getTime()-m.getTime()}));if(T(),l){var u=e.currentYear!==o.getFullYear();e.currentYear=o.getFullYear(),e.currentMonth=o.getMonth(),u&&(x("onYearChange"),R()),x("onMonthChange")}ve(),G(),W(),l||"range"===e.config.mode||1!==e.config.showMonths?void 0!==e.selectedDateElem&&void 0===e.hourElement&&e.selectedDateElem&&e.selectedDateElem.focus():X(i),void 0!==e.hourElement&&void 0!==e.hourElement&&e.hourElement.focus(),e.config.closeOnSelect&&("single"===e.config.mode&&!e.config.enableTime||"range"===e.config.mode&&2===e.selectedDates.length&&!e.config.enableTime)&&ke(),H()}}e.parseDate=Ce({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=D,e._setHoursFromDate=_,e._positionCalendar=pe,e.changeMonth=xe,e.changeYear=fe,e.clear=function(n,t){if(void 0===n&&(n=!0),void 0===t&&(t=!0),e.input.value="",void 0!==e.altInput&&(e.altInput.value=""),void 0!==e.mobileInput&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,!0===t&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),!0===e.config.enableTime){var i=ye(e.config);E(i.hours,i.minutes,i.seconds)}e.redraw(),n&&x("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(void 0!==e.calendarContainer&&e.calendarContainer.classList.remove("open"),void 0!==e._input&&e._input.classList.remove("active")),x("onClose")},e.onMouseOver=ge,e._createElement=w,e.createDay=L,e.destroy=function(){void 0!==e.config&&x("onDestroy");for(var n=e._handlers.length;n--;)e._handlers[n].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var t=e.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(i){try{delete e[i]}catch{}})},e.isEnabled=K,e.jumpToDate=j,e.updateValue=W,e.open=function(n,t){if(void 0===t&&(t=e._positionElement),!0===e.isMobile){if(n){n.preventDefault();var i=A(n);i&&i.blur()}return void 0!==e.mobileInput&&(e.mobileInput.focus(),e.mobileInput.click()),void x("onOpen")}if(!e._input.disabled&&!e.config.inline){var o=e.isOpen;e.isOpen=!0,o||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),x("onOpen"),pe(t)),!0===e.config.enableTime&&!0===e.config.noCalendar&&(!1!==e.config.allowInput||void 0!==n&&e.timeContainer.contains(n.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=We,e.set=function(n,t){if(null!==n&&"object"==typeof n)for(var i in Object.assign(e.config,n),n)void 0!==he[i]&&he[i].forEach(function(o){return o()});else e.config[n]=t,void 0!==he[n]?he[n].forEach(function(o){return o()}):De.indexOf(n)>-1&&(e.config[n]=we(t));e.redraw(),W(!0)},e.setDate=function(n,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=e.config.dateFormat),0!==n&&!n||n instanceof Array&&0===n.length)return e.clear(t);Je(n,i),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),j(void 0,t),_(),0===e.selectedDates.length&&e.clear(!1),W(t),t&&x("onChange")},e.toggle=function(n){if(!0===e.isOpen)return e.close();e.open(n)};var he={locale:[Re,Ye],showMonths:[de,h,ue],minDate:[j],maxDate:[j],positionElement:[Ue],clickOpens:[function(){!0===e.config.clickOpens?(D(e._input,"focus",e.open),D(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Je(n,t){var i=[];if(n instanceof Array)i=n.map(function(o){return e.parseDate(o,t)});else if(n instanceof Date||"number"==typeof n)i=[e.parseDate(n,t)];else if("string"==typeof n)switch(e.config.mode){case"single":case"time":i=[e.parseDate(n,t)];break;case"multiple":i=n.split(e.config.conjunction).map(function(o){return e.parseDate(o,t)});break;case"range":i=n.split(e.l10n.rangeSeparator).map(function(o){return e.parseDate(o,t)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));e.selectedDates=e.config.allowInvalidPreload?i:i.filter(function(o){return o instanceof Date&&K(o,!1)}),"range"===e.config.mode&&e.selectedDates.sort(function(o,l){return o.getTime()-l.getTime()})}function Ke(n){return n.slice().map(function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?e.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:e.parseDate(t.from,void 0),to:e.parseDate(t.to,void 0)}:t}).filter(function(t){return t})}function Ue(){e._positionElement=e.config.positionElement||e._input}function x(n,t){if(void 0!==e.config){var i=e.config[n];if(void 0!==i&&i.length>0)for(var o=0;i[o]&&o1||"static"===e.config.monthSelectorType?e.monthElements[t].textContent=re(i.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=i.getMonth().toString(),n.value=i.getFullYear().toString()}),e._hidePrevMonthArrow=void 0!==e.config.minDate&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYeare.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Se(n){var t=n||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(i){return e.formatDate(i,t)}).filter(function(i,o,l){return"range"!==e.config.mode||e.config.enableTime||l.indexOf(i)===o}).join("range"!==e.config.mode?e.config.conjunction:e.l10n.rangeSeparator)}function W(n){void 0===n&&(n=!0),void 0!==e.mobileInput&&e.mobileFormatStr&&(e.mobileInput.value=void 0!==e.latestSelectedDateObj?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Se(e.config.dateFormat),void 0!==e.altInput&&(e.altInput.value=Se(e.config.altFormat)),!1!==n&&x("onValueUpdate")}function Ze(n){var t=A(n),i=e.prevMonthNav.contains(t),o=e.nextMonthNav.contains(t);i||o?xe(i?-1:1):e.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):t.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=a,e.isOpen=!1,function(){var t=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=I(I({},JSON.parse(JSON.stringify(a.dataset||{}))),r),o={};e.config.parseDate=i.parseDate,e.config.formatDate=i.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(g){e.config._enable=Ke(g)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(g){e.config._disable=Ke(g)}});var l="time"===i.mode;i.dateFormat||!i.enableTime&&!l||(o.dateFormat=i.noCalendar||l?"H:i"+(i.enableSeconds?":S":""):(k.defaultConfig.dateFormat||q.dateFormat)+" H:i"+(i.enableSeconds?":S":"")),i.altInput&&(i.enableTime||l)&&!i.altFormat&&(o.altFormat=i.noCalendar||l?"h:i"+(i.enableSeconds?":S K":" K"):(k.defaultConfig.altFormat||q.altFormat)+" h:i"+(i.enableSeconds?":S":"")+" K"),Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:He("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:He("max")});var c=function(g){return function(b){e.config["min"===g?"_minTime":"_maxTime"]=e.parseDate(b,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:c("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:c("max")}),"time"===i.mode&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,o,i);for(var f=0;f-1?e.config[m]=we(d[m]).map(v).concat(e.config[m]):void 0===i[m]&&(e.config[m]=d[m])}i.altInputClass||(e.config.altInputClass=Le().className+" "+e.config.altInputClass),x("onParseConfig")}(),Re(),e.input=Le(),e.input?(e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=w(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),Ue()):e.config.errorHandler(new Error("Invalid input element specified")),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var t=e.config.defaultDate||("INPUT"!==e.input.nodeName&&"TEXTAREA"!==e.input.nodeName||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);t&&Je(t,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()0&&(e.latestSelectedDateObj=e.selectedDates[0]),void 0!==e.config.minTime&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),void 0!==e.config.maxTime&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(t,i){return void 0===t&&(t=e.currentMonth),void 0===i&&(i=e.currentYear),1===t&&(i%4==0&&i%100!=0||i%400==0)?29:e.l10n.daysInMonth[t]}},e.isMobile||function(){var t=window.document.createDocumentFragment();if(e.calendarContainer=w("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(t.appendChild((e.monthNav=w("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=w("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=w("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,de(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(c){e.__hidePrevMonthArrow!==c&&(S(e.prevMonthNav,"flatpickr-disabled",c),e.__hidePrevMonthArrow=c)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(c){e.__hideNextMonthArrow!==c&&(S(e.nextMonthNav,"flatpickr-disabled",c),e.__hideNextMonthArrow=c)}}),e.currentYearElement=e.yearElements[0],ve(),e.monthNav)),e.innerContainer=w("div","flatpickr-innerContainer"),e.config.weekNumbers){var i=function(){e.calendarContainer.classList.add("hasWeeks");var c=w("div","flatpickr-weekwrapper");c.appendChild(w("span","flatpickr-weekday",e.l10n.weekAbbreviation));var f=w("div","flatpickr-weeks");return c.appendChild(f),{weekWrapper:c,weekNumbers:f}}(),o=i.weekWrapper,l=i.weekNumbers;e.innerContainer.appendChild(o),e.weekNumbers=l,e.weekWrapper=o}e.rContainer=w("div","flatpickr-rContainer"),e.rContainer.appendChild(ue()),e.daysContainer||(e.daysContainer=w("div","flatpickr-days"),e.daysContainer.tabIndex=-1),G(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),t.appendChild(e.innerContainer)}e.config.enableTime&&t.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var c=ye(e.config);e.timeContainer=w("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var f=w("span","flatpickr-time-separator",":"),d=oe("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=d.getElementsByTagName("input")[0];var m=oe("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=m.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=F(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?c.hours:function(b){switch(b%24){case 0:case 12:return 12;default:return b%12}}(c.hours)),e.minuteElement.value=F(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():c.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(d),e.timeContainer.appendChild(f),e.timeContainer.appendChild(m),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var g=oe("flatpickr-second");e.secondElement=g.getElementsByTagName("input")[0],e.secondElement.value=F(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():c.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(w("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(g)}return e.config.time_24hr||(e.amPM=w("span","flatpickr-am-pm",e.l10n.amPM[P((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),S(e.calendarContainer,"rangeMode","range"===e.config.mode),S(e.calendarContainer,"animate",!0===e.config.animate),S(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(t);var s=void 0!==e.config.appendTo&&void 0!==e.config.appendTo.nodeType;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!s&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):void 0!==e.config.appendTo&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var u=w("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(u,e.element),u.appendChild(e.element),e.altInput&&u.appendChild(e.altInput),u.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(void 0!==e.config.appendTo?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(o){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+o+"]"),function(l){return D(l,"click",e[o])})}),e.isMobile)!function(){var o=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=w("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=o,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr="datetime-local"===o?"Y-m-d\\TH:i:S":"date"===o?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",void 0!==e.altInput&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}D(e.mobileInput,"change",function(l){e.setDate(A(l).value,!1,e.mobileFormatStr),x("onChange"),x("onClose")})}();else{var t=Ae(Ge,50);e._debouncedChange=Ae(H,300),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&D(e.daysContainer,"mouseover",function(o){"range"===e.config.mode&&ge(A(o))}),D(e._input,"keydown",je),void 0!==e.calendarContainer&&D(e.calendarContainer,"keydown",je),e.config.inline||e.config.static||D(window,"resize",t),void 0!==window.ontouchstart?D(window.document,"touchstart",Ee):D(window.document,"mousedown",Ee),D(window.document,"focus",Ee,{capture:!0}),!0===e.config.clickOpens&&(D(e._input,"focus",e.open),D(e._input,"click",e.open)),void 0!==e.daysContainer&&(D(e.monthNav,"click",Ze),D(e.monthNav,["keyup","increment"],V),D(e.daysContainer,"click",Be)),void 0!==e.timeContainer&&void 0!==e.minuteElement&&void 0!==e.hourElement&&(D(e.timeContainer,["increment"],M),D(e.timeContainer,"blur",M,{capture:!0}),D(e.timeContainer,"click",le),D([e.hourElement,e.minuteElement],["focus","click"],function(o){return A(o).select()}),void 0!==e.secondElement&&D(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),void 0!==e.amPM&&D(e.amPM,"click",function(o){M(o)})),e.config.allowInput&&D(e._input,"blur",ze)}}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&_(e.config.noCalendar?e.latestSelectedDateObj:void 0),W(!1)),h();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&n&&pe(),x("onReady")}(),e}function $(a,r){for(var e=Array.prototype.slice.call(a).filter(function(M){return M instanceof HTMLElement}),p=[],v=0;v